<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const arr=[2,-1,2,3,1,9,0,2,3]
        function maxProduct(arr){
           
            let result;
            let num=-Infinity;
             let  newarr=[]
            for(var i=0;i<arr.length-1;i++){
            
               result=arr[i]*arr[i+1]
               newarr.push(result)
            }
            for(var j=0;j<newarr.length;j++){
                if(num<=newarr[j]){
                    num=newarr[j]
                }
            }
            return num;
        }
      const v=  maxProduct(arr)
       console.log(v)
    </script>
</body>
</html>